package com.song.tools.songtest.beans.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.song.tools.core.util.TimeUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 系统日志表新增响应体
 * </p>
 *
 * @author song tools
 * @since 2024-07-16
 */
@Data
@Schema(title = "SystemLogSaveResponse", description = "系统日志表新增响应体")
public class SystemLogSaveResponse implements Serializable {

    @Serial
    private static final long serialVersionUID = -1;

    /**
     * 主键
     */
    @Schema(title = "id", description = "主键")
    private Long id;
    /**
     * 日志唯一值
     */
    @Schema(title = "logId", description = "日志唯一值")
    private String logId;
    /**
     * 操作ip
     */
    @Schema(title = "requestIp", description = "操作ip")
    private String requestIp;
    /**
     * 日志类型:error=错误日志,info=正常日志
     */
    @Schema(title = "logType", description = "日志类型:error=错误日志,info=正常日志")
    private String logType;
    /**
     * 日志类型:error=错误日志,info=正常日志-中文描述
     */
    @Schema(title = "logType", description = "中文描述：日志类型:error=错误日志,info=正常日志")
    private String logTypeDesc;
    /**
     * 操作描述
     */
    @Schema(title = "description", description = "操作描述")
    private String description;
    /**
     * 类路径
     */
    @Schema(title = "classPath", description = "类路径")
    private String classPath;
    /**
     * 方法名
     */
    @Schema(title = "actionMethod", description = "方法名")
    private String actionMethod;
    /**
     * 请求类型，比如GET、POST等
     */
    @Schema(title = "httpMethod", description = "请求类型，比如GET、POST等")
    private String httpMethod;
    /**
     * 请求报文
     */
    @Schema(title = "requestParam", description = "请求报文")
    private String requestParam;
    /**
     * 响应报文
     */
    @Schema(title = "responseParam", description = "响应报文")
    private String responseParam;
    /**
     * 请求路径
     */
    @Schema(title = "requestUri", description = "请求路径")
    private String requestUri;
    /**
     * 开始时间-时间格式（yyyy-MM-dd HH:mm:ss）
     */
    @JsonFormat(pattern = TimeUtil.DEFAULT_DATE_TIME_PATTERN, timezone = TimeUtil.GMT_8)
    @Schema(title = "startTime", description = "开始时间-时间格式（yyyy-MM-dd HH:mm:ss）")
    private LocalDateTime startTime;
    /**
     * 结束时间-时间格式（yyyy-MM-dd HH:mm:ss）
     */
    @JsonFormat(pattern = TimeUtil.DEFAULT_DATE_TIME_PATTERN, timezone = TimeUtil.GMT_8)
    @Schema(title = "endTime", description = "结束时间-时间格式（yyyy-MM-dd HH:mm:ss）")
    private LocalDateTime endTime;
    /**
     * 耗时（单位：毫秒）
     */
    @Schema(title = "costTime", description = "耗时（单位：毫秒）")
    private Long costTime;
    /**
     * 错误信息
     */
    @Schema(title = "error", description = "错误信息")
    private String error;
    /**
     * 创建人
     */
    @Schema(title = "createUser", description = "创建人")
    private String createUser;
    /**
     * 创建人ID
     */
    @Schema(title = "createUserId", description = "创建人ID")
    private String createUserId;
    /**
     * 创建时间-时间格式（yyyy-MM-dd HH:mm:ss）
     */
    @JsonFormat(pattern = TimeUtil.DEFAULT_DATE_TIME_PATTERN, timezone = TimeUtil.GMT_8)
    @Schema(title = "createTime", description = "创建时间-时间格式（yyyy-MM-dd HH:mm:ss）")
    private LocalDateTime createTime;
}
